/*
 * Project Name: cms_web
 * File Name: ErrorAction.java
 * Copyright: ZKTeco Corporation 2015
 * Description: TODO 请在此处添加对本文件的描述
 * Creator: Administrator
 * Create Date: 2015年3月9日 上午9:52:45
 */
package com.shishuo.cms.action;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.shishuo.cms.service.ConfigService;

@Controller
public class ErrorAction
{
	@Autowired
	private ConfigService configService;

	@RequestMapping(value = "/404.htm", method = RequestMethod.GET)
	public String error404(ModelMap modelMap, HttpServletRequest request, ModelAndView modelAndView) throws Exception
	{
		String viewName = "template/" + configService.getConfigByKey("SYS_THEME") + "/error/404";
		return viewName;
	}
	@RequestMapping(value = "/400.htm", method = RequestMethod.GET)
	public String error400(ModelMap modelMap, HttpServletRequest request, ModelAndView modelAndView) throws Exception
	{
		String viewName = "template/" + configService.getConfigByKey("SYS_THEME") + "/error/400";
		return viewName;
	}

	@RequestMapping(value = "/500.htm", method = RequestMethod.GET)
	public String error500(ModelMap modelMap, HttpServletRequest request, ModelAndView modelAndView) throws Exception
	{
		String viewName = "template/" + configService.getConfigByKey("SYS_THEME") + "/error/500";
		return viewName;
	}
}
